{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "fB4TiOyU2aPk"
      },
      "source": [
        "# ChatLuotuo: an interface for Chinese Alpaca LoRA model\n",
        "\n",
        "Developed by Ziang Leng 冷子昂, Qiyuan Chen 陈启源 and Cheng Li 李鲁鲁.\n",
        "\n",
        "This is a simple script based on the project of Alpaca-LoRA-Server.git\n",
        "\n",
        "TODO: the inference function in previous git is weak, replace it with the same one from evaluation code"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "fXdpt97I5dr7"
      },
      "source": [
        "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/LC1332/Luotuo-Chinese-LLM/blob/main/notebook/ChatLuotuo.ipynb)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "vscode": {
          "languageId": "plaintext"
        }
      },
      "outputs": [],
      "source": [
        "!git clone https://github.com/SirlyDreamer/Luotuo-Chat-Server.git\n",
        "!cd ./Luotuo-Chat-Server && pip install -r requirements.txt"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "vscode": {
          "languageId": "plaintext"
        }
      },
      "outputs": [],
      "source": [
        "%env BASE_URL=decapoda-research/llama-7b-hf\n",
        "%env FINETUNED_CKPT_URL=silk-road/luotuo-lora-7b-0.3"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ULPNl6Lf3f-X"
      },
      "source": [
        "启动下面的代码后，复制开放链接就可以玩了"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "vscode": {
          "languageId": "plaintext"
        }
      },
      "outputs": [],
      "source": [
        "!cd ./Luotuo-Chat-Server && python app.py --base_url $BASE_URL --ft_ckpt_url $FINETUNED_CKPT_URL --port 6006 --share"
      ]
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "provenance": []
    },
    "gpuClass": "standard",
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
